package com.netflix.discovery;

import com.netflix.appinfo.ApplicationInfoManager;
import com.netflix.appinfo.HealthCheckCallback;
import com.netflix.appinfo.HealthCheckHandler;
import com.netflix.appinfo.InstanceInfo;
import org.springframework.lang.Nullable;

import java.util.List;
import java.util.Set;

public interface EurekaClient extends LookupService {

    Applications getApplicationsForARegion(@Nullable String region);

    Applications getApplications(String serviceUrl);

    List<InstanceInfo> getInstancesByVipAddress(String vipAddress, boolean secure);

    List<InstanceInfo> getInstancesByVipAddress(String vipAddress, boolean secure, @Nullable String region);

    List<InstanceInfo> getInstancesByVipAddressAndAppName(String vipAddress, String appName, boolean secure);

    Set<String> getAllKnownRegions();

    InstanceInfo.InstanceStatus getInstanceRemoteStatus();

    @Deprecated
    List<String> getDiscoveryServiceUrls(String zone);

    @Deprecated
    List<String> getServiceUrlsFromConfig(String instanceZone, boolean preferSameZone);

    @Deprecated
    List<String> getServiceUrlsFromDNS(String instanceZone, boolean preferSameZone);

    @Deprecated
    void registerHealthCheckCallback(HealthCheckCallback callback);

    void registerHealthCheck(HealthCheckHandler healthCheckHandler);

    void registerEventListener(EurekaEventListener eventListener);

    boolean unregisterEventListener(EurekaEventListener eventListener);

    HealthCheckHandler getHealthCheckHandler();

    void shutdown();

    EurekaClientConfig getEurekaClientConfig();

    ApplicationInfoManager getApplicationInfoManager();
}
